package com.yishusmt.wechatapi.wechatdev.utils;

/**
 * openid加密
 *
 * @author zhangyi
 * @date 2018/9/3 11:38
 */
public class OpenIdUtil {

    /**
     * openid加密
     *
     * @param openId
     * @return
     */
    public static String encodeOpenId(String openId){
        char[] chars = openId.toCharArray();
        StringBuffer stringBuffer = new StringBuffer();
        for(int i = 0; i < chars.length; i++){
            if(i%2 == 0){
                stringBuffer.append(chars[i]);
            }
        }
        return MD5Util.encryptString(stringBuffer.toString());
    }
}
